//
// Created on 2025/7/21.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef AVCODECVIDEO_ASSET_H
#define AVCODECVIDEO_ASSET_H

#include <cstdint>
#include <string>
#include <utility>

enum AssetType {
    ASSET_NONE = 0,
    ASSET_VIDEO,
    ASSET_AUDIO,
    ASSET_IMAGE,
};


class Asset {
public:
    explicit Asset();
    Asset(const std::string& path, AssetType type);
    virtual ~Asset();
    
    // 因为解码器只有一个而且不由Asset持有，只有初始化解码器时才手动调用函数设置原始时长。
    virtual void SetOriginalDuration(uint64_t originalDuration);
    
    const std::string GetId();
    const std::string GetPath();
    const int32_t GetSourceFd();
    const uint64_t GetOriginalDuration();

protected:
    std::string m_id; // 只可在创建时赋值
    std::string m_path{""}; // 只可在创建时赋值
    AssetType m_type{ASSET_NONE}; // 只可在创建时赋值
    uint64_t m_originalDuration{0}; // 初始化decoder时赋值
};

#endif //AVCODECVIDEO_ASSET_H
